<div class="section">

	<div class="section-title">
    	<?php echo $breadcrumb?>
    </div>
    
    <div class="section-content padding1">
    
    	<form name="InsertContent"  action="" method="post" enctype="multipart/form-data">
    
    	<div class="left">
            
            <h3><?php echo $heading_title?></h3>
        
        </div>
        
    	<div class="right">
        	<input class="button" type="submit" value="<?php echo $button_save?>" />
            <a class="button" href="<?php echo $DIR_CANCEL?>"><?php echo $button_cancel?></a>
             <input type="hidden" id="status" name="status" value="<?php echo $status?>" />
             <input type="hidden" id="mediaid" name="mediaid" value="<?php echo $mediaid?>" />
             <input type="hidden" id="refersitemap" name="refersitemap" value="<?php echo $refersitemap?>" />
        </div>
        <div class="clearer">&nbsp;</div>
        
        
        <div id="container">
        	
            
        	<ul>
                <li><a href="#fragment-1"><span><?php echo $tab_editcontent?></span></a></li>
                
                <?php if($hasTabMap) {?>
                <li><a href="#fragment-2"><span><?php echo $tab_map?></span></a></li>
                
                 <?php } ?>
                 
                <?php if($hasEmail) {?>
                <li><a href="#fragment-3"><span><?php echo $this->document->text['text_email']?></span></a></li>
                <?php } ?>
                
            </ul>
           
            
            <div id="fragment-1">
            	
                <div>
        			
                    <div class="col2 left">
                    	
                        <?php if(!$hasTitle) {?>
                        <p>
                            <label><?php echo $entry_title?></label><br>
                            <input class="text" type="text" name="title" value="<?php echo $title?>" size="60" />
                        </p>
                        <?php } ?>
                        
                        <?php if(!$hasSummary) {?>
                        <p>
                            <label><?php echo $entry_summary?></label><br>
                            <textarea class="text" rows="3" cols="70" name="summary"><?php echo $summary?></textarea>
                        </p>
                        <?php } ?>
                    
                    </div>
                    
                    <div class="col2 right" style="<?php echo $displaynews?>">
                    
                    	<p id="pnImage">
                            <label for="image"><?php echo $entry_image?></label><br />
                            <a id="btnAddImage" class="button"><?php echo $entry_selectphoto?></a><br />
                            <img id="preview" src="<?php echo $imagethumbnail?>" />
                            <input type="hidden" id="imagepath" name="imagepath" value="<?php echo $imagepath?>" />
                            <input type="hidden" id="imageid" name="imageid" value="<?php echo $imageid?>" />
                            <input type="hidden" id="imagethumbnail" name="imagethumbnail" value="<?php echo $imagethumbnail?>" />
                        </p>
                        
                        
                        <div id="errorupload" class="error" style="display:none"></div>
                        
                        <div class="loadingimage" style="display:none"></div>
                        <p>
                        	<a id="btnAddAttachment" class="button"><?php echo $entry_attachment?></a><br />
                        </p>
                        <p id="attachment">
                        </p>
                    	
                        <span id="delfile"></span>
                    </div>
<script language="javascript">
	$(document).ready(function() {
   	// put all your jQuery goodness in here.
<?php
		foreach($attachment as $item)
		{
			if(count($item))
			{
?>
			$('#attachment').append(creatAttachmentRow('<?php echo $item['fileid']?>','<?php echo $item['filename']?>','<?php echo $item['imagethumbnail']?>'));
<?php
			}
		}
?>
 	});

</script>
                    <div class="clearer">&nbsp;</div>
                
                </div>
                
                <div>
                    
                    
                    <p>
                        <textarea name="description" id="editor1" cols="80" rows="10"><?php echo $description?></textarea>
                    </p>
              
                    <?php if($hasTabMap) {?>
                    <p>
                        <label><?php echo $entry_source?></label><br>
                        <input class="text" type="text" name="source" value="<?php echo $source?>" size="40" />
                    </p>
                     <?php } ?>
                
                </div>
                
            </div>
            
            <?php if($hasTabMap) {?>
            <div id="fragment-2">
                <div>
                	<table>
                    	<thead>
                        	<th width="50%"><?php echo $column_menu?></th>
                            <th width="50%"><?php echo $column_parent?></th>
                        </thead>
                        <tbody>
                        	<?php echo $listReferSiteMap?>
                        </tbody>
                    </table>
                	
                
                </div>
            </div>
            <?php } ?>
            
            <?php if($hasEmail) {?>
                <div id="fragment-3">
                    <p>
                        <label><?php echo $this->document->text['text_email']?> 1</label><br>
                        <input class="text" type="text" name="email1" value="<?php echo $email1?>" size="60" />
                    </p>
                    <p>
                        <label><?php echo $this->document->text['text_email']?> 2</label><br>
                        <input class="text" type="text" name="email2" value="<?php echo $email2?>" size="60" />
                    </p>
                    <p>
                        <label><?php echo $this->document->text['text_email']?> 3</label><br>
                        <input class="text" type="text" name="email3" value="<?php echo $email3?>" size="60" />
                    </p>
                </div>
            <?php } ?>
        
        </div>
        
        </form>
    
    </div>

</div>

<script src='<?php echo DIR_JS?>ajaxupload.js' type='text/javascript' language='javascript'> </script>
<script src="<?php echo DIR_JS?>jquery.tabs.pack.js" type="text/javascript"></script>

<script type="text/javascript" charset="utf-8">
var DIR_UPLOADPHOTO = "<?php echo $DIR_UPLOADPHOTO?>";
var DIR_UPLOADATTACHMENT = "<?php echo $DIR_UPLOADATTACHMENT?>";
$(document).ready(function() { 
	setCKEditorType('editor1',2);
	$('#container').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'slow' });
});
</script>

<script src="<?php echo DIR_JS?>uploadpreview.js" type="text/javascript"></script>
<script src="<?php echo DIR_JS?>uploadattament.js" type="text/javascript"></script>